package com.wow.app.promotion.web.personal.module.screen;

import javax.annotation.Resource;
import javax.servlet.http.HttpSession;

import com.alibaba.citrus.turbine.Context;
import com.alibaba.citrus.turbine.Navigator;
import com.alibaba.citrus.turbine.dataresolver.Param;
import com.wow.app.biz.common.SessionUser;
import com.wow.app.biz.common.SessionUtil;
import com.wow.app.biz.page.PageService;
import com.wow.app.dal.dto.PageDO;

public class PageInfo {
	@Resource
	PageService pageService;

	public void execute(@Param("id") String id, Context context,
			HttpSession session, Navigator nav) {
		PageDO pageDO = pageService.getPageByID(Integer.parseInt(id));
		context.put("page", pageDO);
		SessionUser sessionUser = SessionUtil.getSessionUser(session);
		if(pageDO!=null && pageDO.getOwner().equals(sessionUser.getLoginID())){
			context.put("isMy", true);
		}
	}
}